/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * Mainctofprotested.java
 *
 * Created on 11-feb-2009, 9:59:18
 */
package gui;

import data.DataActofProtested;
import on.ActofProtested;

/**
 *
 * Author: Gema Lopez Garcia
 */
public class MaintActofprotested extends logic.ContentiPanel<ActofProtested> {


    /** Creates new form Mainctofprotested */
    public MaintActofprotested() {
        initComponents();
    }

    public MaintActofprotested(int id_acta) {
        initComponents();
        DataActofProtested da= new DataActofProtested();
        da.requerir(id_acta);
        setContenido(da.getList().get(0));
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        JLnumeroActaProtestada = new javax.swing.JLabel();
        JLnumeroActa = new javax.swing.JLabel();
        JLDelegado = new javax.swing.JLabel();
        JLnumLicencia = new javax.swing.JLabel();
        JLcausa = new javax.swing.JLabel();
        JTFnumeroActaProtestada = new javax.swing.JTextField();
        JTFnumeroActa = new javax.swing.JTextField();
        JTFdelegado = new javax.swing.JTextField();
        JTFnumLicencia = new javax.swing.JTextField();
        jScrollPane1 = new javax.swing.JScrollPane();
        JTFcausa = new javax.swing.JTextArea();

        JLnumeroActaProtestada.setText("Numero Acta Protestada");

        JLnumeroActa.setText("Numero Acta");

        JLDelegado.setText("Delegado");

        JLnumLicencia.setText("Numero Licencia");

        JLcausa.setText("Causa");

        JTFnumeroActaProtestada.setMaximumSize(new java.awt.Dimension(11, 11));

        JTFnumeroActa.setMaximumSize(new java.awt.Dimension(11, 11));

        JTFdelegado.setMaximumSize(new java.awt.Dimension(20, 20));

        JTFnumLicencia.setMaximumSize(new java.awt.Dimension(11, 11));

        JTFcausa.setColumns(20);
        JTFcausa.setRows(5);
        JTFcausa.setMaximumSize(new java.awt.Dimension(50, 50));
        jScrollPane1.setViewportView(JTFcausa);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 499, Short.MAX_VALUE)
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(JLnumeroActa)
                                .addGap(74, 74, 74)
                                .addComponent(JTFnumeroActa, javax.swing.GroupLayout.PREFERRED_SIZE, 72, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(JLnumeroActaProtestada)
                                .addGap(18, 18, 18)
                                .addComponent(JTFnumeroActaProtestada, javax.swing.GroupLayout.PREFERRED_SIZE, 72, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addGap(18, 18, 18)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(JLDelegado)
                            .addComponent(JLnumLicencia))
                        .addGap(59, 59, 59)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(JTFnumLicencia, javax.swing.GroupLayout.PREFERRED_SIZE, 71, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(JTFdelegado, javax.swing.GroupLayout.PREFERRED_SIZE, 137, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addComponent(JLcausa))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(JLnumeroActaProtestada)
                            .addComponent(JTFnumeroActaProtestada, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(JLnumeroActa)
                            .addComponent(JTFnumeroActa, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(JTFdelegado, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(JLDelegado))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(JTFnumLicencia, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(JLnumLicencia))))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(JLcausa)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 146, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
    }// </editor-fold>//GEN-END:initComponents
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel JLDelegado;
    private javax.swing.JLabel JLcausa;
    private javax.swing.JLabel JLnumLicencia;
    private javax.swing.JLabel JLnumeroActa;
    private javax.swing.JLabel JLnumeroActaProtestada;
    private javax.swing.JTextArea JTFcausa;
    private javax.swing.JTextField JTFdelegado;
    private javax.swing.JTextField JTFnumLicencia;
    private javax.swing.JTextField JTFnumeroActa;
    private javax.swing.JTextField JTFnumeroActaProtestada;
    private javax.swing.JScrollPane jScrollPane1;
    // End of variables declaration//GEN-END:variables

    @Override
    public void setContenido(ActofProtested o) {
        this.JTFnumeroActaProtestada.setText(o.getId_actaProtestada() + "");
        this.JTFdelegado.setText(o.getNombreDelegado());
        this.JTFnumeroActa.setText(o.getId_acta() + "");
        this.JTFnumLicencia.setText(o.getNumeroLicencia());
        this.JTFcausa.setText(o.getCauses_protesta());

    }

    @Override
    public ActofProtested getContenido() {
        ActofProtested o = new ActofProtested();
        o.setId_actaProtestada(Integer.parseInt(this.JTFnumeroActaProtestada.getText()));
        o.setNombreDelegado(this.JTFdelegado.getText());
        o.setId_acta(Integer.parseInt(this.JTFnumeroActa.getText()));
        o.setNumeroLicencia(this.JTFnumLicencia.getText());
        o.setCauses_protesta(this.JLcausa.getText());
        return o;
    }

    @Override
    public void enableTextFields(boolean boo) {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public void clearTextFields() {
        throw new UnsupportedOperationException("Not supported yet.");
    }
}
